<?php
class Image extends Element{
	
	private $authorizedElements = array();
	
	private $alt;
	
	private $src;
	
	private $num;
	
	function __construct($src, $alt){
		$this->alt = $alt;
		$this->src = $src;
		$_SESSION['images'][$_SESSION['nbrImage']] = $this->src;
		$this->num = ($_SESSION['nbrImage']++);
	}
	
	function toString($menu = true){
		$str = '<img src="enhanceImage.php?image=' . $this->num . '&filtre=none" alt="'.$this->alt.'" id="image_' . $this->num . '" /><br />';
		return $str;
	}
	
	function __toString(){
		
		$str = '<img src="enhanceImage.php?image=' . $this->num . '&filtre=none" alt="'.$this->alt.'" id="image_' . $this->num . '" /><br />';
		return $str;
		//return '<img src="' . $this->src . '" alt=' . $this->alt . '" />';
	}
	
	function get_num(){
		return $this->num;
	}
	
}
?>